package com.jk.smartelderlycare.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jk.smartelderlycare.dto.SysLabel;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Update;

public interface SysLabelMapper extends BaseMapper<SysLabel> {
    /**
     * @description: 标签后端分页查询
     * @param: [sysLabel, page]
     * @return: com.baomidou.mybatisplus.core.metadata.IPage<com.jk.smartelderlycare.dto.SysLabel>
     * @author hhk
     * @date: 2024/11/14 15:01
     */
    IPage<SysLabel> findSysLabelPagimationList(SysLabel sysLabel, Page<SysLabel> page);
    /**
     * @description: 根据id删除中间表
     * @param: [labelId]
     * @return: void
     * @author hhk
     * @date: 2024/11/14 15:26
     */
    @Delete("delete from sys_tution_label where label_id = #{labelId}")
    void deleteLabelAndTutionByLabelId(Long labelId);
    /**
     * @description: 状态修改
     * @param: [sysLabel]
     * @return: void
     * @author hhk
     * @date: 2024/11/14 16:01
     */
    @Update("update sys_label set status = #{status} where label_id =#{labelId}  ")
    void updateStatus(SysLabel sysLabel);
}